package com.hmz.backend.controller.account;

import cn.hutool.json.JSONObject;
import com.hmz.backend.service.account.LoginService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
public class LoginController {
    @Resource(name = "loginUserService") //具名注入
    private LoginService loginUserService;
    @PostMapping("/login")
    public JSONObject login(@RequestBody JSONObject data){
        return loginUserService.login(data);
    }
    @GetMapping("/getUserInfo")
    public JSONObject getUserInfo(@RequestParam String token){
        return loginUserService.getUserInfo(token);
    }
}
